Skip to main content

List Medications

GET/api/v1/users/me/medications

Lists the medications prescribed on the authenticated patient's cases. One row per CaseDecisionMedInfo. Optionally filtered by case. Cursor-paginated by id descending.

cv-api-key + Bearer accessToken
Productionhttps://api.care360-next.carevalidate.com/api/v1/users/me/medications
Staginghttps://api-staging.care360-next.carevalidate.com/api/v1/users/me/medications

Headers

Headers
cv-api-keystringrequired
Your unique API key for authentication.
Authorizationstringrequired
Bearer access token from /verify-otp.
Example: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...

Query Parameters

Query Parameters
caseIdstringoptional
UUID. Restrict the list to a single case owned by the patient. Verified via ensurePatientOwnsCase — if the case does not belong to the patient or to the calling org, returns 403.
Example: 550e8400-e29b-41d4-a716-446655440000
limitintegeroptional
Page size. 1–100. Defaults to 20.
Example: 20
afterstringoptional
Cursor — the last id from the previous page (the CaseDecisionMedInfo id). The server skips this row and returns the next page.
Example: 550e8400-e29b-41d4-a716-446655440000

Behavior

  1. If caseId is provided, ensurePatientOwnsCase confirms the case exists, the submitterId === userId, and the organizationId matches the calling org. Otherwise → 403 VALIDATION_ERROR "You do not have access to this case".
  2. If caseId is omitted, the server resolves the patient's own case ids in this org.
  3. The DB query returns CaseDecisionMedInfo rows whose parent CaseDecision.caseId is in that set, ordered by the parent decision's createdAt descending, then id ascending.
  4. Each med row is flattened together with its parent decision's caseId, startDate (returned as prescribedDate), isApproved, and the decision's addedBy user (prescriber).
  5. The server takes limit + 1 rows to detect end-of-results, drops the extra, and emits its id as nextCursor. When no more rows exist, nextCursor is null.

A single CaseDecision with multiple medications produces multiple rows in this response — one per med info. If the patient has no cases (or no medications), data.medications is [] and data.nextCursor is null.

Response Shape

See Medications Overview › Medication for the per-row field list. The response is:

{ "status": 200, "success": true, "data": { "medications": [ "..." ], "nextCursor": "<id> | null" } }

Example Request

curl -X GET '<BASE_URL>/api/v1/users/me/medications' \
-H 'cv-api-key: <redacted>' \
-H 'Authorization: Bearer <accessToken>'

Responses

200SuccessReturns the patient's prescribed medications matching the filters.
{
"status": 200,
"success": true,
"data": {
"medications": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"medicine": "Amoxicillin",
"dosage": "500 mg",
"refillCount": 2,
"dosingFrequency": "twice daily",
"treatmentPeriod": "10 days",
"isRefill": false,
"pharmacyInstructions": "Take with food.",
"prescribedDate": "2026-04-15T12:34:56.000Z",
"caseId": "550e8400-e29b-41d4-a716-446655440111",
"isApproved": true,
"prescriber": {
"id": "550e8400-e29b-41d4-a716-446655440222",
"firstName": "Alex",
"lastName": "Smith",
"title": "MD"
}
}
],
"nextCursor": "550e8400-e29b-41d4-a716-446655440000"
}
}
400Validation errorcv-api-key missing, caseId / after not a UUID, or limit out of range.
{
"status": 400,
"success": false,
"error": "Validation failed",
"code": "VALIDATION_ERROR"
}
401Authentication failureAuth-middleware rejection (any cause is collapsed into this generic response).
{
"status": 401,
"success": false,
"error": "Invalid or expired token",
"code": "VALIDATION_ERROR"
}
403Case not ownedcaseId does not belong to the patient or to the calling org.
{
"status": 403,
"success": false,
"error": "You do not have access to this case",
"code": "VALIDATION_ERROR"
}

Try It Out